#{extends 'main.html' /}
#{set title:'Topics' /}

<div class="series_tab">
<div class="series_title">${series?.name}</div>
<div class="series_follow">
#{if user?.follows?.contains(series)}
	<img src="@{'/public/images/remove_icon.png'}" width="14" height="14" border="0" style="vertical-align:middle;" /> 
	<a href="/s/${series?.id}/unfollow">Unfollow</a>
#{/if}
#{else}
<img src="@{'/public/images/plus_icon.gif'}" width="14" height="14" border="0" style="vertical-align:middle;" /> 
    <a href="/s/${series?.id}/follow">Follow</a>
#{/else}
</div>
<div class="series_follow">
	<img src="@{'/public/images/facebookShareIcon.png'}" width="14" height="14" border="0" style="vertical-align:middle;" />
	<a href=""  onclick="postToFeed('${series?.name} @ TV World', 'http://54.246.83.207:9007${series?.poster}', '${user?.name} follows ${series?.name}', '${series?.name} @ TV World', 'http://apps.facebook.com/cengdoi-gg/s/${series?.id}',''); return false;">Share</a>
</div>
</div>

<div class="clear" style="height: 10px;"></div>

<div class="series_menu">
<a href="/s/${series?.id}" class="series_menu_a">Details</a> 
<a href="/s/${series?.id}/topics" class="series_menu_a_active">Topics</a> 
<a href="/s/${series?.id}/videos" class="series_menu_a">Videos</a> 
<a href="/s/${series?.id}/episodes" class="series_menu_a">Episodes</a>
</div>

<div class="clear" style="height: 10px;"></div>

<div class="series_follow">

<img src="@{'/public/images/topic_icon.gif'}" width="16" height="16" border="0" style="vertical-align:middle;" /> 
    <a href="/s/${series?.id}/newtopic">New Topic</a>

</div>

<div class="clear" style="height: 10px;"></div>

<div class="topic-row">
	<div class="delete-topic"></div>
	<div class="left-topic" style="text-decoration: underline;">Topic</div>
	<div class="center-topic" style="text-decoration: underline;"><a href="/s/${series.id}/topics/sort/date">Date</a></div>
	<div class="center2-topic" style="text-decoration: underline;"><a href="/s/${series.id}/topics/sort/comments">#Comments</a></div>
	<div class="right-topic" style="text-decoration: underline;">Owner</div>
	<div class="clear"></div>
</div>

#{paginate.list items:paginator, as:'topic'}
<div class="topic-row">

<div class="delete-topic">
#{if user?.topicList?.contains(topic)}
<a class="delete-comment-button" href="/s/${series?.id}/deletetopic/${topic?.id}"></a>
#{/if}
</div>

<div class="left-topic">

<a href="/s/${topic.serie.id}/topicdetail/${topic.id}">${topic.topicName}</a></div>

<div class="center-topic">${topic.getFormattedDate()}</div>

<div class="center2-topic">${topic.commentTopicList.size()}</div>

<div class="right-topic">${topic.user.name}</div>       


</div>
#{/paginate.list} 
#{paginate.controls items:paginator /}

